<template>
	<view>
		<u-swiper v-if="bannerList.length" :list="bannerList" mode='number' indicator-pos='bottomRight' border-radius='16' @click='clickBanner'></u-swiper>
		<view class="u-p-l-20 u-p-r-20">
			<w-list :list='list' :status='status'>
				<template>
					<view v-for="(item,index) in list" :key="index">
						<w-shop-item :item='item'></w-shop-item>
					</view>
				</template>
			</w-list>
		</view>
	</view>
</template>

<script>
	export default {
		name: "w-shop-commodity",
		props: {
			bannerList: {
				type: Array,
				default: ()=>{
					return []
				}
			},
			list: {
				type: Array,
				default: ()=>{
					return []
				}
			},
			status:{
				type: String,
				default:'loadmore'
			}
		},
		data() {
			return {
			};
		},
		methods: {
			clickBanner(index) {
				const path = this.bannerList[index].surface
				if(path){
					if(path.includes('http')){
						this.$u.route({
							url:'/pages/index/webview/webview',
							params:{
								src:path
							}
						})
					}else{
						this.$u.route({
							url:'/pages/shop/detail/detail',
							params:JSON.parse(this.bannerList[index].param)
						})
					}
				}
			}
		},
	}
</script>

<style lang="scss">

</style>
